<?php 
require_once('geoiploc.php');
require_once('genxipdetect.php');

$obj = new GetIPDetails();

	if(ini_get('allow_url_fopen') && $obj->is_connected()){ 
		$details = $obj->get_ip_details(getIp());  
	}else{
		$details = getCountryFromIP(getIp(), " NamE ");
	}

echo '<pre>';
print_r($details);
echo '<pre>';